package com.hs.kfk.serializer;

import java.util.Objects;

/**
 * @Description: User 实体
 * @Author 胡尚
 * @Date: 2024/8/8 12:38
 */
public class User {
    private Long uId;
    private String username;
    private Integer age;

    public User() {
    }

    public User(Long uId, String username, Integer age) {
        this.uId = uId;
        this.username = username;
        this.age = age;
    }

    public Long getuId() {
        return uId;
    }

    public void setuId(Long uId) {
        this.uId = uId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "uId=" + uId +
                ", username='" + username + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        User user = (User) o;
        return Objects.equals(uId, user.uId) && Objects.equals(username, user.username) && Objects.equals(age, user.age);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uId, username, age);
    }
}
